﻿<!--
Project: ClipFlair (http://ClipFlair.codeplex.com)
Filename: GalleryWindow.xaml
Version: 20141031
-->

<clipflair:BaseWindow x:Class="ClipFlair.Windows.GalleryWindow"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:pivot="clr-namespace:System.Windows.Controls.Pivot;assembly=System.Windows.Controls.Pivot"
  xmlns:pivotex="clr-namespace:PivotViewerExt;assembly=PivotViewerExt"
  xmlns:clipflair="clr-namespace:ClipFlair.Windows;assembly=ClipFlair.Windows.Base"
  xmlns:con="clr-namespace:Microsoft.Internal.Pivot.Controls;assembly=System.Windows.Controls.Pivot"
  xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
  xmlns:options="clr-namespace:ClipFlair.Windows.Options"                      
  mc:Ignorable="d"
  d:DesignWidth="800" d:DesignHeight="600"
  >

  <clipflair:BaseWindow.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/ClipFlair.Windows.Base;component/Themes/Generic.xaml" />
        <ResourceDictionary Source="/PivotViewerExt;component/Themes/Generic.xaml" />
      </ResourceDictionary.MergedDictionaries>

     <!-- <utils:HtmlEncodedToDecodedStringConverter x:Key="EncodedToDecodedStringConverter" /> -->

      <Style x:Key="GalleryItemAdornerStyle" TargetType="pivot:PivotViewerItemAdorner">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="pivot:PivotViewerItemAdorner">
              <pivot:PivotViewerDefaultItemAdorner
                IsTabStop="False"
                IsItemSelected="{Binding IsItemSelected, RelativeSource={RelativeSource TemplatedParent}}"
                CommandsRequested="GalleryItemAdorner_CommandsRequested"
                Style="{StaticResource DefaultItemAdornerStyle}"                
                />
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
      <!-- DataContext="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" -->

    </ResourceDictionary>
  </clipflair:BaseWindow.Resources>

  <!--<clipflair:BaseWindow.FrontContent>-->

  <toolkit:BusyIndicator BusyContent="Loading..." IsBusy="{Binding RelativeSource={RelativeSource Self}, Path=Content.IsLoading}">

    <pivotex:PivotViewerExt Name="pivot"
      HorizontalAlignment="Stretch" VerticalAlignment="Stretch"

      Background="Transparent"
      ControlBackground="Transparent"       

      Source="{Binding Source, Mode=TwoWay}"
      Filter="{Binding Filter, Mode=TwoWay}"
      ItemAdornerStyle="{StaticResource GalleryItemAdornerStyle}"              
      />

  </toolkit:BusyIndicator>

  <!--</clipflair:BaseWindow.FrontContent>-->

  <clipflair:BaseWindow.PropertyItems>

    <options:GalleryOptions x:Name="galleryOptions" DataContext="{Binding}" /> <!-- uses our DataContext (the View) -->

  </clipflair:BaseWindow.PropertyItems>

</clipflair:BaseWindow>
